<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Nintendorks Chatter</title>
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<style type="text/css" media="screen">@import "/iui/iui.css";</style>

<script type="text/javascript" src="/images/main.js"></script>

</head>

<body>
    <div class="toolbar">
        <!-- h1 id="pageTitle">{{threadTitle}}</h1 -->
        <a class="centerButton" href="#" onclick="gotoPage({{threadID}}, {{forumID}}, {{numReplies}}); return false;"><span>Page {{currentPage}} of {{totalPages}}</span></a>
        <a id="backButton" class="button" href="/forum?f={{forumID}}">Forum</a>
        <a class="button" href="/post?mode=reply&t={{threadID}}&f={{forumID}}&start={{start}}&numReplies={{numReplies}}">Reply</a>
    </div>
    
    <ul id="thread" title="{{threadTitle}}" selected="true">

	<li class="threadTitle"><div align="center">
	{{threadTitle}}<br/>
	</div></li>
	
	<li class="plain"><div align="center">
	{% ifnotequal prevStart "" %}
	<a class="smallRoundButton" href="/thread?id={{threadID}}&forumID={{forumID}}&start={{prevStart}}&numReplies={{numReplies}}">&#9668;</a>
	{% else %}
	<div class="smallClearButton"> </div>
	{% endifnotequal %}

	<div class="smallRoundButton" onclick="scrollTo(0, 999999)">&#9660;</div>

	{% ifnotequal nextStart "" %}
	<a class="smallRoundButton" href="/thread?id={{threadID}}&forumID={{forumID}}&start={{nextStart}}&numReplies={{numReplies}}">&#9658;</a>
	{% else %}
	<div class="smallClearButton"> </div>
	{% endifnotequal %}
	</div></li>

	{% if retrievalError %}
		<li>
			<span style="{ color: #FF0000; font-size: 16px; text-align: center; }">
			Retrieval error! Try refreshing.</span>
		</li>
	{% else %}	
		{% for post in posts %}
		  <a name="{{post.id}}"></a>
		  {% ifequal post.id unreadPost %}
		  <a name="unread"></a>
		  {% endifequal %}
		  <li class="user">
		    <table width="100%">
		      <tr>
		        <td width="45">
		          {% ifnotequal post.avatar "" %}
		          <div align="center">
		          <img src="{{post.avatar}}" class="avatar"></img>
		          </div>
		          {% endifnotequal %}
		        </td>
		        <td>
		          <div style="float:left;">
		          {{post.user}}<br>
		          <div class="postTime">{{post.time}}</div>
		          </div>
		        </td>
		        <td>
		          <div style="float:right;">
		          {% ifnotequal post.editable "" %}
		          <a href="/post?mode=edit&id={{post.id}}&t={{threadID}}&f={{forumID}}&start={{start}}&numReplies={{numReplies}}"><img src="images/editicon.png"></img></a>
		          {% endifnotequal %}
		          {% ifequal post.editable "" %}
		          <img src="images/clearicon.png"></img>
		          {% endifequal %}
		          <a href="/post?mode=quote&id={{post.id}}&t={{threadID}}&f={{forumID}}&start={{start}}&numReplies={{numReplies}}"><img src="images/quoteicon.png"></img></a>
		          </div>
		        </td>
		      </tr>
		    </table>
		  </li>
		  <li class="postText">{{post.text}}</li>
		{% endfor %}
	{% endif %}
	
	<li class="plain">
      <form name="replyForm" class="reply" method="post" action="/post">
        <fieldset>
            <h1>Reply</h1>            
            <textarea class="replyTextArea" name="message" rows="5"></textarea>
            <input type="hidden" name="mode" value="reply" />
            <input type="hidden" name="forumID" value="{{forumID}}" />
            <input type="hidden" name="threadID" value="{{threadID}}" />
            <input type="hidden" name="numReplies" value="{{numReplies}}" />
            <input type="hidden" name="start" value="{{start}}" />
            <input type="hidden" name="topic_cur_post_id" value="{{topic_cur_post_id}}" />
            <input type="hidden" name="lastclick" value="{{lastclick}}" />
            <input type="hidden" name="creation_time" value="{{creation_time}}" />
            <input type="hidden" name="form_token" value="{{form_token}}" />
            <a type="submit" id="replyButton" class="button2 grayButton" href="javascript: document.replyForm.submit()">Post</a>
        </fieldset>
      </form>
	</li>
	
	<li class="plain"><div align="center">
	{% ifnotequal prevStart "" %}
	<a class="smallRoundButton" href="/thread?id={{threadID}}&forumID={{forumID}}&start={{prevStart}}&numReplies={{numReplies}}">&#9668;</a>
	{% else %}
	<div class="smallClearButton"> </div>
	{% endifnotequal %}

	<div class="smallRoundButton" onclick="scrollTo(0, 1)">&#9650;</div>

	{% ifnotequal nextStart "" %}
	<a class="smallRoundButton" href="/thread?id={{threadID}}&forumID={{forumID}}&start={{nextStart}}&numReplies={{numReplies}}">&#9658;</a>
	{% else %}
	<div class="smallClearButton"> </div>
	{% endifnotequal %}
	</div></li>
	<li class="threadTitle">
	<div style="font-size: 13px; font-weight: normal;" align="center">
	<form method="get" name="jumpbox" action="./forum" onsubmit="if(document.jumpbox.f.value == -1){return false;}" style="margin: -3px 0 -4px 0;">	
	<select onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }" name="f">	
		<option value="-1">Select a forum</option>
		<option value="newposts">New Posts</option>
		<option value="1">General Blabbery</option>
		<option value="2">Entertaining Entertainment</option>
		<option value="3">Games Galore</option>
		<option value="4">Nerdvana</option>
		<option value="6">Nintendorks, Assemble!</option>
		<option value="7">The Marching Banned</option>
		<option value="8">The Dumping Ground</option>		
	</select>
	</form>
	</div>
	</li>
	<li class="plain">
    <div class="toolbar2">
        <a id="backButton" class="button" href="/forum?f={{forumID}}">Forum</a>
        <a class="centerButton" href="#" onclick="gotoPage({{threadID}}, {{forumID}}, {{numReplies}}); return false;"><span>Page {{currentPage}} of {{totalPages}}</span></a>
        <a class="button" href="/post?mode=reply&t={{threadID}}&f={{forumID}}&start={{start}}&numReplies={{numReplies}}">Reply</a>
    </div>
	</li>
	</ul>

	{% ifequal bottom "true" %}
	<!-- Provide enough time for the slide transition to occur before scrolling down -->
	<img src="/images/clear.gif" onLoad="setTimeout(scrollTo, 300, 0, 999999);"></script>
	{% else %}
		{% ifequal bottom "ignore" %}
		<!-- Do nothing -->
		{% else %}
			{% ifequal unreadPost "" %}
			<!-- When page loads, hide menu bar -->
			<img src="/images/clear.gif" onLoad="setTimeout(scrollTo, 300, 0, 1);">
			{% endifequal %}
		{% endifequal %}
	{% endifequal %}


    {% include "googleanalytics.html" %}
    </body>
</html>